package com.jiutong.meipengdai.views.popwindow;

import android.content.Context;
import android.view.View;
import android.widget.Button;
import android.widget.ImageView;

import com.jiutong.meipengdai.R;

public class LoanApplyPopupWindow extends BasePopupWindow implements View.OnClickListener {

    private OnBtnClickLister mLister;
    private ImageView ivCancel;
    private Button btnSubmit;

    public LoanApplyPopupWindow(Context context) {
		super(context);
	}

	@Override
	public void initView() {
        ivCancel = (ImageView) mContainer.findViewById(R.id.iv_cancel);
        btnSubmit = (Button) mContainer.findViewById(R.id.btn_submit);

        setAnimationStyle(R.style.AnimFade);
    }

	@Override
	public void initEvent() {
        ivCancel.setOnClickListener(this);
        btnSubmit.setOnClickListener(this);
	}

	@Override
	public View getContentView() {
		return mContainer.findViewById(R.id.pop);
	}

	@Override
	public int getLayoutId() {
		return R.layout.pop_loan_apply;
	}

    @Override
    public void onClick(View v) {
        switch (v.getId()){
            case R.id.iv_cancel:
                dismiss();
                break;

            case R.id.btn_submit:
                mLister.onClick();
                dismiss();
                break;
        }
    }

    public void setOnBtnClickLister(OnBtnClickLister lister){
        this.mLister = lister;
    }


    public interface OnBtnClickLister{
        void onClick();
    }
}
